package Mangos::DB::Mangos::ItemTemplate;

use strict;

use base qw(Mangos::DB::Mangos);

__PACKAGE__->meta->setup
(
    table   => 'item_template',

    columns => 
    [
        entry                     => { type => 'integer', not_null => 1 },
        class                     => { type => 'integer', default => '0', not_null => 1 },
        subclass                  => { type => 'integer', default => '0', not_null => 1 },
        unk0                      => { type => 'integer', default => '-1', not_null => 1 },
        name                      => { type => 'varchar', default => '', length => 255, not_null => 1 },
        displayid                 => { type => 'integer', default => '0', not_null => 1 },
        Quality                   => { type => 'integer', default => '0', not_null => 1 },
        Flags                     => { type => 'integer', default => '0', not_null => 1 },
        Faction                   => { type => 'integer', default => '0', not_null => 1 },
        BuyCount                  => { type => 'integer', default => 1, not_null => 1 },
        BuyPrice                  => { type => 'integer', default => '0', not_null => 1 },
        SellPrice                 => { type => 'integer', default => '0', not_null => 1 },
        InventoryType             => { type => 'integer', default => '0', not_null => 1 },
        AllowableClass            => { type => 'integer', default => '-1', not_null => 1 },
        AllowableRace             => { type => 'integer', default => '-1', not_null => 1 },
        ItemLevel                 => { type => 'integer', default => '0', not_null => 1 },
        RequiredLevel             => { type => 'integer', default => '0', not_null => 1 },
        RequiredSkill             => { type => 'integer', default => '0', not_null => 1 },
        RequiredSkillRank         => { type => 'integer', default => '0', not_null => 1 },
        requiredspell             => { type => 'integer', default => '0', not_null => 1 },
        requiredhonorrank         => { type => 'integer', default => '0', not_null => 1 },
        RequiredCityRank          => { type => 'integer', default => '0', not_null => 1 },
        RequiredReputationFaction => { type => 'integer', default => '0', not_null => 1 },
        RequiredReputationRank    => { type => 'integer', default => '0', not_null => 1 },
        maxcount                  => { type => 'integer', default => '-1', not_null => 1 },
        stackable                 => { type => 'integer', default => 1, not_null => 1 },
        ContainerSlots            => { type => 'integer', default => '0', not_null => 1 },
        StatsCount                => { type => 'integer', default => '0', not_null => 1 },
        stat_type1                => { type => 'integer', default => '0', not_null => 1 },
        stat_value1               => { type => 'integer', default => '0', not_null => 1 },
        stat_type2                => { type => 'integer', default => '0', not_null => 1 },
        stat_value2               => { type => 'integer', default => '0', not_null => 1 },
        stat_type3                => { type => 'integer', default => '0', not_null => 1 },
        stat_value3               => { type => 'integer', default => '0', not_null => 1 },
        stat_type4                => { type => 'integer', default => '0', not_null => 1 },
        stat_value4               => { type => 'integer', default => '0', not_null => 1 },
        stat_type5                => { type => 'integer', default => '0', not_null => 1 },
        stat_value5               => { type => 'integer', default => '0', not_null => 1 },
        stat_type6                => { type => 'integer', default => '0', not_null => 1 },
        stat_value6               => { type => 'integer', default => '0', not_null => 1 },
        stat_type7                => { type => 'integer', default => '0', not_null => 1 },
        stat_value7               => { type => 'integer', default => '0', not_null => 1 },
        stat_type8                => { type => 'integer', default => '0', not_null => 1 },
        stat_value8               => { type => 'integer', default => '0', not_null => 1 },
        stat_type9                => { type => 'integer', default => '0', not_null => 1 },
        stat_value9               => { type => 'integer', default => '0', not_null => 1 },
        stat_type10               => { type => 'integer', default => '0', not_null => 1 },
        stat_value10              => { type => 'integer', default => '0', not_null => 1 },
        ScalingStatDistribution   => { type => 'integer', default => '0', not_null => 1 },
        ScalingStatValue          => { type => 'integer', default => '0', not_null => 1 },
        dmg_min1                  => { type => 'float', default => '0', not_null => 1, precision => 32 },
        dmg_max1                  => { type => 'float', default => '0', not_null => 1, precision => 32 },
        dmg_type1                 => { type => 'integer', default => '0', not_null => 1 },
        dmg_min2                  => { type => 'float', default => '0', not_null => 1, precision => 32 },
        dmg_max2                  => { type => 'float', default => '0', not_null => 1, precision => 32 },
        dmg_type2                 => { type => 'integer', default => '0', not_null => 1 },
        armor                     => { type => 'integer', default => '0', not_null => 1 },
        holy_res                  => { type => 'integer', default => '0', not_null => 1 },
        fire_res                  => { type => 'integer', default => '0', not_null => 1 },
        nature_res                => { type => 'integer', default => '0', not_null => 1 },
        frost_res                 => { type => 'integer', default => '0', not_null => 1 },
        shadow_res                => { type => 'integer', default => '0', not_null => 1 },
        arcane_res                => { type => 'integer', default => '0', not_null => 1 },
        delay                     => { type => 'integer', default => 1000, not_null => 1 },
        ammo_type                 => { type => 'integer', default => '0', not_null => 1 },
        RangedModRange            => { type => 'float', default => '0', not_null => 1, precision => 32 },
        spellid_1                 => { type => 'integer', default => '0', not_null => 1 },
        spelltrigger_1            => { type => 'integer', default => '0', not_null => 1 },
        spellcharges_1            => { type => 'integer', default => '0', not_null => 1 },
        spellppmRate_1            => { type => 'float', default => '0', not_null => 1, precision => 32 },
        spellcooldown_1           => { type => 'integer', default => '-1', not_null => 1 },
        spellcategory_1           => { type => 'integer', default => '0', not_null => 1 },
        spellcategorycooldown_1   => { type => 'integer', default => '-1', not_null => 1 },
        spellid_2                 => { type => 'integer', default => '0', not_null => 1 },
        spelltrigger_2            => { type => 'integer', default => '0', not_null => 1 },
        spellcharges_2            => { type => 'integer', default => '0', not_null => 1 },
        spellppmRate_2            => { type => 'float', default => '0', not_null => 1, precision => 32 },
        spellcooldown_2           => { type => 'integer', default => '-1', not_null => 1 },
        spellcategory_2           => { type => 'integer', default => '0', not_null => 1 },
        spellcategorycooldown_2   => { type => 'integer', default => '-1', not_null => 1 },
        spellid_3                 => { type => 'integer', default => '0', not_null => 1 },
        spelltrigger_3            => { type => 'integer', default => '0', not_null => 1 },
        spellcharges_3            => { type => 'integer', default => '0', not_null => 1 },
        spellppmRate_3            => { type => 'float', default => '0', not_null => 1, precision => 32 },
        spellcooldown_3           => { type => 'integer', default => '-1', not_null => 1 },
        spellcategory_3           => { type => 'integer', default => '0', not_null => 1 },
        spellcategorycooldown_3   => { type => 'integer', default => '-1', not_null => 1 },
        spellid_4                 => { type => 'integer', default => '0', not_null => 1 },
        spelltrigger_4            => { type => 'integer', default => '0', not_null => 1 },
        spellcharges_4            => { type => 'integer', default => '0', not_null => 1 },
        spellppmRate_4            => { type => 'float', default => '0', not_null => 1, precision => 32 },
        spellcooldown_4           => { type => 'integer', default => '-1', not_null => 1 },
        spellcategory_4           => { type => 'integer', default => '0', not_null => 1 },
        spellcategorycooldown_4   => { type => 'integer', default => '-1', not_null => 1 },
        spellid_5                 => { type => 'integer', default => '0', not_null => 1 },
        spelltrigger_5            => { type => 'integer', default => '0', not_null => 1 },
        spellcharges_5            => { type => 'integer', default => '0', not_null => 1 },
        spellppmRate_5            => { type => 'float', default => '0', not_null => 1, precision => 32 },
        spellcooldown_5           => { type => 'integer', default => '-1', not_null => 1 },
        spellcategory_5           => { type => 'integer', default => '0', not_null => 1 },
        spellcategorycooldown_5   => { type => 'integer', default => '-1', not_null => 1 },
        bonding                   => { type => 'integer', default => '0', not_null => 1 },
        description               => { type => 'varchar', default => '', length => 255, not_null => 1 },
        PageText                  => { type => 'integer', default => '0', not_null => 1 },
        LanguageID                => { type => 'integer', default => '0', not_null => 1 },
        PageMaterial              => { type => 'integer', default => '0', not_null => 1 },
        startquest                => { type => 'integer', default => '0', not_null => 1 },
        lockid                    => { type => 'integer', default => '0', not_null => 1 },
        Material                  => { type => 'integer', default => '0', not_null => 1 },
        sheath                    => { type => 'integer', default => '0', not_null => 1 },
        RandomProperty            => { type => 'integer', default => '0', not_null => 1 },
        RandomSuffix              => { type => 'integer', default => '0', not_null => 1 },
        block                     => { type => 'integer', default => '0', not_null => 1 },
        itemset                   => { type => 'integer', default => '0', not_null => 1 },
        MaxDurability             => { type => 'integer', default => '0', not_null => 1 },
        area                      => { type => 'integer', default => '0', not_null => 1 },
        Map                       => { type => 'integer', default => '0', not_null => 1 },
        BagFamily                 => { type => 'integer', default => '0', not_null => 1 },
        TotemCategory             => { type => 'integer', default => '0', not_null => 1 },
        socketColor_1             => { type => 'integer', default => '0', not_null => 1 },
        socketContent_1           => { type => 'integer', default => '0', not_null => 1 },
        socketColor_2             => { type => 'integer', default => '0', not_null => 1 },
        socketContent_2           => { type => 'integer', default => '0', not_null => 1 },
        socketColor_3             => { type => 'integer', default => '0', not_null => 1 },
        socketContent_3           => { type => 'integer', default => '0', not_null => 1 },
        socketBonus               => { type => 'integer', default => '0', not_null => 1 },
        GemProperties             => { type => 'integer', default => '0', not_null => 1 },
        RequiredDisenchantSkill   => { type => 'integer', default => '-1', not_null => 1 },
        ArmorDamageModifier       => { type => 'float', default => '0', not_null => 1, precision => 32 },
        Duration                  => { type => 'integer', default => '0', not_null => 1 },
        ItemLimitCategory         => { type => 'integer', default => '0', not_null => 1 },
        HolidayId                 => { type => 'integer', default => '0', not_null => 1 },
        ScriptName                => { type => 'varchar', default => '', length => 64, not_null => 1 },
        DisenchantID              => { type => 'integer', default => '0', not_null => 1 },
        FoodType                  => { type => 'integer', default => '0', not_null => 1 },
        minMoneyLoot              => { type => 'integer', default => '0', not_null => 1 },
        maxMoneyLoot              => { type => 'integer', default => '0', not_null => 1 },
    ],

    primary_key_columns => [ 'entry' ],
);

1;

package Mangos::DB::Mangos::ItemTemplate::Manager;

use strict;
use warnings;

use base 'Rose::DB::Object::Manager';

sub object_class { 'Mangos::DB::Mangos::ItemTemplate' }

__PACKAGE__->make_manager_methods('item_template');

1;
